package ${package.DTO};

<#list table.importPackages as pkg>
import ${pkg};
</#list>
<#if springdoc>
import io.swagger.v3.oas.annotations.media.Schema;
<#elseif swagger>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
</#if>
<#if entityLombokModel>
import lombok.Data;
    <#if chainModel>
import lombok.experimental.Accessors;
    </#if>
</#if>
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import javax.validation.constraints.*;

/**
* @description ${table.comment!}DTO对象
* @author ${author}
* @time ${date}
*/
<#if entityLombokModel>
@Data
    <#if chainModel>
        @Accessors(chain = true)
    </#if>
</#if>
@Builder
@AllArgsConstructor
@NoArgsConstructor
<#if springdoc>
@Schema(name = "${entity}DTO", description = "${table.comment!}DTO对象")
<#elseif swagger>
@ApiModel(value = "${entity}DTO对象", description = "${table.comment!}DTO对象")
</#if>
public class ${entity}DTO {

<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
    <#if field.comment!?length gt 0>
        <#if springdoc>
    @Schema(description = "${field.comment}")
        <#elseif swagger>
    @ApiModelProperty("${field.comment}")
        <#else>
            /**
            * ${field.comment}
            */
        </#if>
    </#if>
    <#if !field.keyFlag && field.propertyType == "String">
    @NotBlank(message = "${field.comment}不能为空")
    <#elseif !field.keyFlag>
    @NotNull(message = "${field.comment}不能为空")
    </#if>
    private ${field.propertyType} ${field.propertyName};

</#list>
<#------------  END 字段循环遍历  ---------->
}